/*
 *  FoodTree.h
 *  Meal Wheel
 *
 *  Created by Justin Dell on 7/4/08.
 *  Copyright 2008 . All rights reserved.
 *
 */
 
/* 
    C++ Class that provies a structure for the food tree.
    FoodTree is an interface to deal with a vector of Food objects
    Food is an object that gives foods a name and a vector of
        types, along with functions to modify them
*/
 
#include <vector>
#include <string>
using namespace std;

class Food {
public:
    
    // Constructors
    Food();
    Food(string name, vector<string> types);
    
    // Destructor
    ~Food();
    
    // Copy
    void operator=(Food copy);
    
    void addType(string type);
    void setName(string name);
    string getName();
    vector<string> getTypes();
    
private:
    
    vector<string> mTypes;
    string mName;
};

class FoodTree  {
public:

    // Constructor
    FoodTree();
    
    // Destructor
    ~FoodTree();
    
    // Copy 
    void operator=(FoodTree copy);
    
    vector<Food *> getFoodsByType(string type);
    Food* getFoodByName(string name);
    Food* getFoodByIndex(int index);
    void addFood(Food *xFood);
    void addFood(string name);
    void addFood(string name, vector<string> types);
    void removeFood(string name);
    void addTypeToFood(string type);
    void addTypeToFood(string type, string name);
    void writeXML(const char *path);
    int size();
    
private:

    vector<Food *> mFoods;
};